export default {
    props: {
        i: 0,
        data: {
            itemId: 0,
            checked: false,
            num: 0,
            itemName: "",
            itemPrice: 0,
            itemDescription: "",
            itemImagePath: [],
        }
    },
    computed: {
        coverImage: function () {
            return this.data.itemImagePath[0]
        }
    },
    checkedChange() {
        this.$emit(
            "checkedChange",
            {
                i: this.i,
            }
        )
    },
    numMinusOne() {
        this.$emit(
            "numMinusOne",
            {
                i: this.i,
            }
        )
    },
    numPlusOne() {
        this.$emit(
            "numPlusOne",
            {
                i: this.i,
            }
        )
    },
    setNum(event) {
        this.$emit(
            "numPlusOne",
            {
                i: this.i,
                num: event.value
            }
        )
    }
}
